import { getLevelFirst, getLevelZero, getUserID } from '@/utils';

const ManageTabSwitch = (curRes: Record<string, any>) => {
  /**
   * 权限判断方法
   * */
  const ManageTabCurResSwitch1 = () => {
    if (curRes?.['/Controller/createCompanyID']) {
      return {
        createCompanyID: getLevelZero(),
        params: 'createCompanyID',
        key: 'key1',
      };
    } else if (curRes?.['/Controller/createDepartmentID']) {
      return {
        createDepartmentID: getLevelFirst(),
        params: 'createDepartmentID',
        key: 'key1',
      };
    } else if (curRes?.['/Controller/createrID']) {
      return {
        createrID: getUserID(),
        params: 'createrID',
        key: 'key1',
      };
    }
  };

  const ManageTabCurResSwitch2 = () => {
    if (curRes?.['/Controller/myMaterialCheck']) {
      return {
        createCompanyID: getLevelZero(),
        params: 'createCompanyID',
        key: 'key2',
        state: 1,
      };
    }
  };

  return [
    // {
    //     title: '管理',
    //     key: 'key1',
    //     visible: true,
    //     md: 2,
    //     sm: 24,
    //     params: ManageTabCurResSwitch1(),
    // },
    // {
    //     title: '我的',
    //     key: 'key2',
    //     visible: true,
    //     md: 2,
    //     sm: 24,
    //     params: ManageTabCurResSwitch2(),
    // },
  ];
};
export { ManageTabSwitch };
